package com.yunbao.web.interceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by louisyuu on 2020/3/12 下午4:31
 */
public interface HandlerInterceptor {


    /**
     * @param request
     * @param response
     * @param handler  {@link com.yunbao.web.servlet.HandlerMethod}
     * @return
     * @throws Exception
     */
    default boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {

        return true;
    }


    default void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, Object result) throws Exception {
    }


    default void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
    }
}
